sunxi: improve throughput in the sunxi_mmc driver
authorPhilipp Tomsich <[email protected]>
Wed, 21 Mar 2018 11:18:58 +0000 (12:18 +0100)
committerJagan Teki <[email protected]>
Wed, 25 Apr 2018 04:59:38 +0000 (10:29 +0530)
commit5ff8e54888e4d26a352453564f7f599d29696dc9
treed28014452b59790ad13496f1b1e249874e2039c5
parent4744d81cc0dbe238bd4d8cd88c1c71022bffa621
sunxi: improve throughput in the sunxi_mmc driver

Throughput tests have shown the sunxi_mmc driver to take over 10s to
read 10MB from a fast eMMC device due to excessive delays in polling
loops.

This commit restructures the main polling loops to use get_timer(...)
to determine whether a (millisecond) timeout has expired.  We choose
not to use the wait_bit function, as we don't need interruptability
with ctrl-c and have at least one case where two bits (one for an
error condition and another one for completion) need to be read and
using wait_bit would have not added to the clarity.

The observed speedup in testing on a A31 is greater than 10x (e.g. a
10MB write decreases from 9.302s to 0.884s).

Signed-off-by: Philipp Tomsich <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Tested-by: Mylène Josserand <[email protected]>
Acked-by: Jagan Teki <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
drivers/mmc/sunxi_mmc.c